#!/usr/bin/perl5

$^I=".bak";

while (<>) {
	next if /<!--\s*WEBMAGIC.*-->\s*$/;
	&remove_SGI_stuff;
	&fix_paths;
	&remove_comments;
	print;
}

sub remove_SGI_stuff {
	s#SGI_FULLPATH="[\w/\-\.]*"##g;
	s/SGI_SETHEIGHT//g;
	s/SGI_SETWIDTH//g;
}

sub fix_paths {
	s#/usr/ns-home/docs/monkey/##g;
}

sub remove_comments {
	s/<!--\s*.*\s*-->//g;
}

